import request from 'umi-request';

export async function queryCadreList(params,value) {
  return request('/hr-ssc/api/api-admin/regular/getRegularBpmList', {
    method: 'post',
    data: {
      ...params,
      pageNum: params.current,
      pageSize: params.pageSize,
      regularBpmStatus:value,
      userCode:params.code,
      name:params.name,
      type:[2,3]
    },
  }).then((res) => {
    const data = res.data;
    return {
      current: data.currPage,
      data: data.list,
      pageSize: data.pageSize,
      success: true,
      total: data.totalCount,
    };
  });
}

export async function updateExpeditionDate(params) {
  return request('/hr-ssc/api/api-admin/promotion/doExpedition', {
    method: 'POST',
    data: {
      promotionId:params.promotionId,
      expeditionStatus:params.expeditionStatus,
      beginExpeditionDate:params.beginExpeditionDate,
      expeditionDays:params.expeditionDays
    },
    requestType: 'form'
  }).then((res) => {
    return res;
  });
}
